#include <iostream>
#include <algorithm> 
using namespace std;

struct pat{
	string name;
	double t;
	int flag;
	
}s;
int c;
int main()
{
   int n;
   while(n--)
   {
   	cin >> s.name >> s.t >> s.flag;
   	if(s.t>=37.5 && s.flag == 1)
   	{
   		cout << s.name << endl;
   		c++;
	   }
   }
   cout << c << endl;
}
